
<?php	
	
	class customer extends database
	{
		var $connection = '';	

		function customer()
		{
			parent::database();
		}
	
		function GetListPaging()
		{						
			$this->setQuery("set names utf8");
			$this->query();
			return $sql = "Select * from vnf_customer";			
			//return $pager;
			//$rs = $pager->paginate();
	//Loop through the result set
				
			/*$this->setQuery($sql);
			$value = $this->loadAllRow();
			return $value;*/
		}
		
		function GetList()
		{						
			$this->setQuery("set names utf8");
			$this->query();
			$sql = "Select * from vnf_customer";			
						
			$this->setQuery($sql);
			$value = $this->loadAllRow();
			return $value;
		}
		
		/*function AddCustomer($LastName, $FirstName, $left, $right, $status, $main_image, $short_description, $description, $main_menu, $template_id, $keywords, $tag_description, $friendly_url, $SortPriority, $FeaturedCategory, $CatFomProduct, $photo_link, $embed_youtube, $NaturalSearchDescription)
		{
			$this->setQuery("set names utf8");
			$this->query();
			$sql = "insert into `vnf_customer`(`admin_title`, `parent`, `left`, `right`, `status`, `main_image`, `short_description`, 
            `description`, `main_menu`, `template_id`, `keywords`, `tag_description`, `friendly_url`, `SortPriority`, 
            `FeaturedCategory`, `CatFomProduct`, `photo_link`, `embed_youtube`, `NaturalSearchDescription`)
            values('".$admin_title."', '".$parent."', '".$left."', '".$right."', '".$status."', '".$main_image."', 
            '".$short_description."', '".$description."', '".$main_menu."', '".$template_id."', 
            '".$keywords."', '".$tag_description."', '".$friendly_url."', '".$SortPriority."', 
            '".$FeaturedCategory."', '".$CatFomProduct."', '".$photo_link."', '".$embed_youtube."','".$NaturalSearchDescription."')";
  
			$this->setQuery($sql);
			$this->query();
		}*/
		
		function UpdateCustomer($status, $id)
		{
			$this->setQuery("set names utf8");
			$this->query();
			$sql = "";
			$sql = "Update vnf_customer set `status` =  '".$status."'";
			$sql .= " where CustomerNo=".$id;			
			//echo $sql;
			$this->setQuery($sql);
			$this->query();
		}
		
		function GetOneCustomer($id)
		{
			$this->setQuery("set names utf8");
			$this->query();
			$sql = "Select * from vnf_customer where CustomerNo=".$id."";
			$this->setQuery($sql);
			$row = $this->loadOneRow();
			return $row;
		}
		
		function DeleteCustomer($id)
		{
			$this->setQuery("set names utf8");
			$this->query();
			$sql = "";
			$sql = "Delete from vnf_customer";
			$sql .= " where CustomerNo=".$id;			
			
			$this->setQuery($sql);
			$this->query();
		}
	}
?>